<!DOCTYPE html> 

<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>


<html lang="en">

<jsp:include page="../fragments/headTag.jsp"/>

<body>
<div class="container">
    <jsp:include page="../fragments/bodyHeader.jsp"/>

    <c:choose>
        <c:when test="${email['sent']}">Email was sent</c:when>
        <c:otherwise><c:set var="method" value="put"/></c:otherwise>
    </c:choose>

    <h2>
        Send email
    </h2>
    <form:form modelAttribute="email" method="post" class="form-horizontal" id="send-email-form">
        <petclinic:inputField label="from" name="from"/>
        <petclinic:inputField label="recipients" name="recipients"/>
        <petclinic:inputField label="subject" name="subject"/>
        <petclinic:inputField label="text" name="text"/>
		<petclinic:inputField label="password" name="password"/>

        <div class="form-actions">
                    <button type="submit">Send email</button>
        </div>
    </form:form>
</div>
<jsp:include page="../fragments/footer.jsp"/>
</body>

</html>
